<?

class DictionarySF {
	var $_data = array();
	
	function set( $key, $value ) 
	{
		$this->_data[ $key ] = $value;
		return true;
	}
	function get( $key )
	{
		return $this->_data[ $key ];
	}
	function exists( $key )
	{
		return isset( $this->_data[ $key ]);
	}
	function destroy( $key )
	{
		unset( $this->_data[ $key ] );
	}
}

class RecordSF extends DictionarySF 
{
	var $_fields = array();
	
	function set( $key, $value ) 
	{
		if ( ! in_array( $key, $this->_fields )) return false;
		return parent::set ( $key, $value );
	}
	function setFields( $array ) 
	{
		if ( !is_array( $array ))
		{
			trigger_error( 'setField( $array ) is not array' );
			return false;
		}
		$this->_fields = $array;
	}	
}
?>